import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/mes-qms/qms_lock_material/page',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

export const partLock = (data) => {
  return request({
    url: '/api/mes-qms/qms_lock_material/lock',
    method: 'post',
    data
  });
};

export const unLock = (data) => {
  return request({
    url: '/api/mes-qms/qms_lock_material/unlock',
    method: 'post',
    data
  });
};

export const getLotNo = (params) => {
  return request({
    url: '/api/mes-admin/partner/batch-list',
    method: 'get',
    params: params
  });
};
export const getVendotcode = (params) => {
  return request({
    url: '/api/mes-warehouse/packing/get-vendor-code',
    method: 'get',
    params: params
  });
};

// 根据工单号查询工序列表
export const getRoutesByWo = (workorderId) => {
  return request({
    url: '/api/mes-product/process/product-route/workorder-routes-by-wo',
    method: 'get',
    params: {
      workorderId
    }
  });
};

// 判断工单类型下是否有工序的锁定
export const validLockRequestByProcessRouteId = (row) => {
  return request({
    url: '/api/mes-warehouse/lockrequest/validLockRequestByProcessRouteId',
    method: 'post',
    data: row
  });
};

export const getWlList = (current, size, params) => {
  return request({
    url: '/api/mes-admin/part-master/page',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

export const getBzList = (current, size, params) => {
  return request({
    url: '/api/mes-warehouse/receiving/page',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

// 扫描产品序列号的接口
export const getProductSn = (workOrderNo, sequenceNumber) => {
  return request({
    url: 'api/mes-product/product/query-product-sequence-number',
    method: 'get',
    params: {
      workOrderNo,
      sequenceNumber
    }
  });
};
